package fh.bsys.threading.app;

import fh.bsys.threading.classes.Testtable_unsynched;

/**
 * creates 4 Threads of the unsynchronized Testclass and starts them.
 * If the threads are ready with testing, the table is printed to stdout.
 * @author muetze
 *
 */
public class Unsynched {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Thread tc1 = new Thread(new TestClassunsynched("unsynched1"));
		Thread tc2 = new Thread(new TestClassunsynched("unsynched2"));
		Thread tc3 = new Thread(new TestClassunsynched("unsynched3"));
		Thread tc4 = new Thread(new TestClassunsynched("unsynched4"));
		
		tc1.start();
		tc2.start();
		tc3.start();
		tc4.start();

		while (tc1.isAlive()) {};
		while (tc2.isAlive()) {} ;
		while (tc3.isAlive()) {} ;
		while (tc4.isAlive()) {} ;
		
		Testtable_unsynched.getInstance().print();

	}

}
